package com.smartian.v2;

import android.util.Log;

import java.text.SimpleDateFormat;

/**
 * Created by tianweitong on 2020/2/27.
 */

public class OpLog {

    private static  final SimpleDateFormat SDF = new SimpleDateFormat();
    public static boolean canUse = false;

    public static void e(String tag, String s) {
        if(!canUse) return;
        Log.e(tag,s);
    }

    public static void d(String tag, String s) {
        if(!canUse) return;
        Log.w(tag,s);
    }

    public static String formatTime(long time) {
        try{
            if(time<=0){
                return String.valueOf(time);
            }
            return SDF.format(time);
        }catch (Exception e){
            e.printStackTrace();
        }
        return "";
    }
}
